package com.hk.commons.entity.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Index;

/**
 * 系统资源
 * 
 * @author saga
 * 
 */
@Entity
@Table(name = "SysResource")
public class SysResource implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1910678897573431970L;

	@Id
	@Column(name = "Id", length = 20)
	private Long id;

	@Column(name = "Name", length = 40)
	@Index(name = "idx_name")
	private String name;

	@Column(name = "Description", length = 40)
	private String descp;

	@Column(name = "Code", length = 10)
	private String code;

	@Column(name = "URI", length = 255)
	@Index(name = "idx_uri")
	private String uri;

	/**父节点 */
	@Column(name = "ParentId", length = 10)
	private Long parentId;
	
	/**树节点 */
	@Column(name = "LevelId", length = 5)
	private Integer levelId;
	
	/**资源类型： 1菜单	2按钮*/
	@Column(name = "ResType", length = 2)
	private Short resType;
	
	/**标示一组资源*/
	@Column(name = "ResFlag", length = 30)
	private String resFlag;
	
	@Column(name = "CreatedTS")
	private Long createdts;

	@Column(name = "Creator", length = 20)
	private String creator;
	
	
	public String getResFlag() {
		return resFlag;
	}

	public void setResFlag(String resFlag) {
		this.resFlag = resFlag;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Integer getLevelId() {
		return levelId;
	}

	public void setLevelId(Integer levelId) {
		this.levelId = levelId;
	}

	public Short getResType() {
		return resType;
	}

	public void setResType(Short resType) {
		this.resType = resType;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescp() {
		return descp;
	}

	public void setDescp(String descp) {
		this.descp = descp;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}
	
	public Long getCreatedts() {
		return createdts;
	}

	public void setCreatedts(Long createdts) {
		this.createdts = createdts;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String account) {
		this.creator = account;
	}

	@Override
	public String toString() {
		return "SysResource{" +
				"id=" + id +
				", name='" + name + '\'' +
				", descp='" + descp + '\'' +
				", code='" + code + '\'' +
				", uri='" + uri + '\'' +
				", parentId=" + parentId +
				", levelId=" + levelId +
				", resType=" + resType +
				", resFlag='" + resFlag + '\'' +
				", createdts=" + createdts +
				", creator='" + creator + '\'' +
				'}';
	}
}
